@page
@{ Layout = "_Layout"; }

<el-card>
    <el-scrollbar class="scrollbar" :style="{height: ($(window).height() - 118) + 'px'}">

        <el-form v-on:submit.native.prevent ref="form" :model="form" :size="euiSize" status-icon label-width="260px" style="margin-right:25px;">
            <el-form-item label="是否禁用用户中心">
                <el-radio v-model="form.isHomeClosed" :label="true">禁用</el-radio>
                <el-radio v-model="form.isHomeClosed" :label="false">启用</el-radio>
                <div class="tips">控制用户中心登录界面是否启用验证码功能</div>
            </el-form-item>
  <el-form-item label="密码最小长度" prop="userPasswordMinLength" :rules="[
    { required: true, message: '请输入密码最小长度' },
    { validator: utils.validateInt }
  ]">
    <el-input v-model:number="form.userPasswordMinLength"></el-input>
    <small class="tips">0代表不限制密码长度</small>
  </el-form-item>
  <el-form-item label="密码规则限制">
    <el-select v-model="form.userPasswordRestriction" class="form-control">
      <el-option :label="getPasswordRestrictionText('LetterAndDigit')" value="LetterAndDigit"></el-option>
      <el-option :label="getPasswordRestrictionText('LetterAndDigitAndSymbol')" value="LetterAndDigitAndSymbol"></el-option>
      <el-option :label="getPasswordRestrictionText('None')" value="None"></el-option>
    </el-select>
  </el-form-item>

  <el-form-item label="登录失败锁定">
    <el-radio v-model="form.isUserLockLogin" :label="true">开启登录失败锁定</el-radio>
    <el-radio v-model="form.isUserLockLogin" :label="false">不锁定</el-radio>
  </el-form-item>
  <el-form-item v-if="form.isUserLockLogin" label="登录失败锁定（次）" prop="userLockLoginCount" :rules="[
    { required: true, message: '请输入登录失败锁定' },
    { validator: utils.validateInt }
  ]">
    <el-input v-model:number="form.userLockLoginCount"></el-input>
    <small class="tips">一旦登录失败达到指定次数之后用户就会被锁定</small>
  </el-form-item>
  <el-form-item v-if="form.isUserLockLogin" label="用户登录锁定类型">
    <el-select v-model="form.userLockLoginType">
      <el-option value="Hours" label="按小时锁定"></el-option>
      <el-option value="Forever" label="永久锁定"></el-option>
    </el-select>
  </el-form-item>
  <el-form-item v-if="form.isUserLockLogin && form.userLockLoginType === 'Hours'" label="登录锁定时间（小时）" prop="userLockLoginHours" :rules="[
    { required: true, message: '请输入登录锁定时间' },
    { validator: utils.validateInt }
  ]">
    <el-input v-model:number="form.userLockLoginHours"></el-input>
  </el-form-item>
  <el-form-item label="是否禁用验证码">
    <el-radio v-model="form.isUserCaptchaDisabled" :label="true">禁用</el-radio>
    <el-radio v-model="form.isUserCaptchaDisabled" :label="false">启用</el-radio>
    <div class="tips">控制用户中心登录界面是否启用验证码功能</div>
  </el-form-item>
</el-form>
    </el-scrollbar>
    <el-divider></el-divider>
    <div style="height: 10px"></div>
    <el-row>
        <el-col :span="24" align="center">
            <el-button type="primary" v-on:click="btnSubmitClick" :size="euiSize">保 存</el-button>
        </el-col>
    </el-row>
</el-card>

@section Scripts{
<script src="/sitefiles/assets/js/admin/settings/usersConfig.js" type="text/javascript"></script> }